package com.ugoodtech.mdcc.core.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;

/* Copyright (C) Ugoodtech, Inc - All Rights Reserved.
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 * Proprietary and confidential.
 * Written by Stone Shaw.
 */
@ApiModel("问券章节")
@Entity
@Table(name = "question_section")
public class QuestionSection extends BaseEntity {
    @ApiModelProperty("名称")
    private String name;
    @ApiModelProperty("index")
    private Integer idx;
    @ApiModelProperty("问卷模型")
    private QuestionPaper paper;
    @ApiModelProperty("包含的题目数量")
    private Long questionNum;
    @ApiModelProperty("拥有者")
    private Integer owner;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getIdx() {
        return idx;
    }

    public void setIdx(Integer idx) {
        this.idx = idx;
    }

    public Integer getOwner() {
        return owner;
    }

    public void setOwner(Integer owner) {
        this.owner = owner;
    }

    @ManyToOne
    @JoinColumn(name = "paper_id")
    @JsonIgnore
    public QuestionPaper getPaper() {
        return paper;
    }

    public void setPaper(QuestionPaper paper) {
        this.paper = paper;
    }

    @Transient
    public Long getQuestionNum() {
        return questionNum;
    }

    public void setQuestionNum(Long questionNum) {
        this.questionNum = questionNum;
    }
}
